<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Socket</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="/js/jquery-1.10.2.js"></script>
    <script src="/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>

</head>
<body class="login-bg" background->

<div class="login layui-anim layui-anim-up">
    <div class="message">聊天窗</div>
    <div id="darkbannerwrap"></div>

    <form  class="layui-form" id="form">
        <input name="username" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
        <hr class="hr15">
        <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
        <hr class="hr15">
        <!--<input required type="text" placeholder="验证码" autocomplete="off" style="width:140px" maxlength="6" class="layui-input" name="code">-->
        <!--<hr class="hr15">-->
        <!--<img src="{:captcha_src()}" alt="captcha" onclick="this.src=this.src+'?'+Math.random()"/>-->
        <hr class="hr15">
        <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>

</div>

<script>
    $('#form').submit(function (event) {
        //ajax方式提交form表单信息给服务器
        event.preventDefault(); //阻止浏览器form表单提交
        var name = $('input[name="username"]').val();
        var password = $('input[name="password"]').val();
        var code = $('input[name="code"]').val();
        //监听提交
        $.ajax({
            url: 'Http/index/index',
            type: 'post',
            data: {name:name,password:password,code:code},
            dataType: 'json',
            success: function (msg) {
                if (msg.code === 1) {

                    location.href = '/index/index/index.html';
                } else {
                    layer.alert(msg.msg, {icon: 5});
                }
            }
        });
    })



</script>


<!-- 底部结束 -->

</body>
</html>